package com.itheima.dao;
/*
* 类型转换
* */
public class demo5 {
    public static void main(String[] args) {
        /*int a = 10;				// int 4个字节
        byte b = (byte)a;		// byte 1个字节		错误: 不兼容的类型: 从int转换到byte可能会有损失精度
        System.out.println(b);

        double num1 = 12.9;
        int num2 = (int)num1;
        System.out.println(num2);*/

       /* int a = 10;
        byte b = (byte)a;
        System.out.println(b);

        double num1 = 12.9;
        int num2 = (int)num1;
        System.out.println(num2);*/

        int a = 10;
        byte b = (byte)a;
        System.out.println(b);

        double num1 = 12.9;
        int num2 = (int)num1;
        System.out.println(num2);
    }
}
